package com.easipay.designpattern.observer.observer;

import com.easipay.designpattern.observer.subject.Subject;

/**
 * concreate interface
 * @author Administrator
 *
 */
public class ThirdPartyDisplay implements Observer {

private Subject weatherData;
	
	private float temperature;
	    
	private float humidity;
	    
	private float pressure;
	
	public ThirdPartyDisplay(Subject weatherData){
		this.weatherData = weatherData;
		this.weatherData.registerObserver(this);
	}

	public void update(float temp, float humidity, float pressure) {
		this.humidity = humidity;
		this.temperature = temp;
		this.pressure = pressure;
		display();
	}

	public void display(){
		System.out.println("ThirdPartyDisplay:temperature-->"+temperature+" humidity-->"+humidity+" pressure-->"+pressure);
	}


}
